package org.springblade.modules.admin.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @Date 10:40 2023/2/9
 * @Description {
 *   维保业务日志类型
 * }
 * @Author lsay
 **/
@Getter
@AllArgsConstructor
public enum MaintainBusinessLogEnum {

	DEPT_UPDATE(1, "部门更新"),

	ELEVATOR_MAINTAIN_PRINCIPAL_DEPT_UPDATE(2, "电梯维保责任组更新"),

	ELEVATOR_MAINTAIN_PRINCIPAL_USER_UPDATE(3, "电梯维保责任人更新");

	final int type;

	final String desc;

	/**
	 * 根据status获取枚举name值
	 * @param type 枚举status
	 * @return desc值
	 */
	public static String getDesc(Integer type){
		if (type == null) {
			return null;
		}

		MaintainBusinessLogEnum[] values = MaintainBusinessLogEnum.values();
		for(MaintainBusinessLogEnum statusEnum :values){
			Integer enumType = statusEnum.getType();
			if(enumType.equals(type)){
				return statusEnum.getDesc();
			}
		}
		return null;
	}
}
